using System;
using UnityEngine;
using UnityEngine.UI;

namespace CGF
{
    //该脚本自动生成或覆盖，不可编辑
    public partial class PanelSalesIncome
    {   
		public CButton BtnBack;
		public Image Table;
		public Text TextTotal;
		public CButton BtnSelectTime;
		public RectTransform Cart;
		public I18N i18n;

        public Reference reference { get; private set; }
        public Action onProsBindCompleted;
        
        public void BindProperties(Transform transform)
        {   
            reference = transform.GetComponent<Reference>();
            if(!reference)return;
            int nodeIndex = 0;
			BtnBack = (reference.nodes[nodeIndex++].obj as GameObject).GetComponent<CButton>();
			Table = (reference.nodes[nodeIndex++].obj as GameObject).GetComponent<Image>();
			TextTotal = (reference.nodes[nodeIndex++].obj as GameObject).GetComponent<Text>();
			BtnSelectTime = (reference.nodes[nodeIndex++].obj as GameObject).GetComponent<CButton>();
			Cart = (reference.nodes[nodeIndex++].obj as GameObject).GetComponent<RectTransform>();
			i18n = transform.GetComponent<I18N>();
            onProsBindCompleted?.Invoke();
        }
        
        public void SetProsBindCompletedAction(Action action)
        {
            onProsBindCompleted = action;
        }

		public string I18N_total_income { get { return i18n.GetTextByKey("total_income"); } }
		public string I18N_detail { get { return i18n.GetTextByKey("detail"); } }
    }
}
